

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>有赞订单管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <#include "../../include/layui.ftl" />
    <#include "../../include/pTable.ftl" />
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <form  id="queryForm">
                <input type="hidden" id="className" name="className" value="${className!}" />
                <input type="hidden" id="modleName" name="modleName" value="${modleName!}" />
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">商品名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="goods_title" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">收货人名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="receiver_name" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">收货人号码</label>
                        <div class="layui-input-block">
                            <input type="text" name="receiver_phone" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </form>
        </div>

        <div class="layui-card-body">

            <table id="lay-table" lay-filter="lay-table"></table>
            <script type="text/html" id="toolbar">
            </script>
        </div>
    </div>
</div>
<script>
    var $ = null,layer = null,$tables = null,table = null;
    layui.config({
        base: '${path}/plug-in/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','tables','layers','view'],function () {
        var tables = layui.tables,
            view = layui.view,
            layers = layui.layers;
        $ = layui.$,layer = layui.layer,table = layui.table;
        var parmer = {
            url:'/console/youzanOrder/rewrite/list',
            request: {
                pageName: 'page_no' //页码的参数名称，默认：page
                , limitName: 'page_size' //每页数据量的参数名，默认：limit
            },
            cols:[[
                    {field:"tid",width:'8%',title:"订单号",templet:function (d) {
                        console.log(d);
                        return d.full_order_info.order_info.tid;
                    }}
                    ,{field:"pay_type_str",width:'8%',title:"支付类型",templet: function(d){
                        var type = d.full_order_info.order_info.pay_type_str;
                        if(type == 'WEIXIN'){
                            return '微信自有支付';
                        }else if(type == 'WEIXIN_DAIXIAO'){
                            return '微信代销支付';
                        }else if(type == 'ALIPAY'){
                            return '支付宝支付';
                        }else if(type == 'BANKCARDPAY'){
                            return '银行卡支付';
                        }else if(type == 'PEERPAY'){
                            return '代付';
                        }else if(type == 'CODPAY'){
                            return '货到付款';
                        }else if(type == 'BAIDUPAY'){
                            return '百度钱包支付';
                        }else if(type == 'PRESENTTAKE'){
                            return '直接领取赠品';
                        }else if(type == 'COUPONPAY'){
                            return '优惠券/码全额抵扣';
                        }else if(type == 'BULKPURCHASE'){
                            return '来自分销商的采购';
                        }else if(type == 'MERGEDPAY'){
                            return '合并付货款';
                        }else if(type == 'ECARD'){
                            return '有赞E卡支付';
                        }else if(type == 'PURCHASE_PAY'){
                            return '采购单支付';
                        }else if(type == 'MARKPAY'){
                            return '标记收款';
                        }else if(type == 'OFCASH'){
                            return '现金支付';
                        }else if(type == 'PREPAIDCARD'){
                            return '储值卡余额支付';
                        }else if(type == 'ENCHASHMENT_GIFT_CARD'){
                            return '礼品卡支付';
                        }else{
                            return '其他支付';
                        }
                    }}
                    ,{field:"success_time",width:'10%',title:"订单成功时间",templet: function(d){
                        return d.full_order_info.order_info.update_time;
                    }}
                    ,{field:"mobile",width:'8%',title:"粉丝昵称",templet:function (d) {
                        return d.full_order_info.buyer_info.fans_nickname;
                    }}
                    ,{field:"mobile",width:'8%',title:"粉丝号码",templet:function (d) {
                        return d.full_order_info.buyer_info.buyer_phone;
                    }}
                    ,{field:"express_type",width:'8%',title:"物流类型",templet:function (d) {
                        var express_type = d.full_order_info.order_info.express_type;
                        if(express_type == 0){
                            return '快递发货';
                        }else if(express_type == 1){
                            return '到店自提';
                        }else if(express_type == 2){
                            return '同城配送';
                        }else if(express_type == 9){
                            return '无需发货（虚拟商品订单）';
                        }
                    }}
                    ,{field:"mobile",width:'8%',title:"收货人名称",templet:function (d) {
                        return d.full_order_info.address_info.receiver_name;
                    }}
                    ,{field:"mobile",width:'8%',title:"收货人号码",templet:function (d) {
                        return d.full_order_info.address_info.receiver_tel;
                    }}
                    ,{field:"consign_time",width:'8%',title:"发货时间",templet:function (d) {
                        return d.full_order_info.order_info.consign_time;
                    }}
                    ,{field:"mobile",width:'8%',title:"订单状态",templet:function (d) {
                        return d.full_order_info.order_info.status_str;
                    }}
                    ,{field:"book_key",width:'8%',title:"订单唯一识别码",templet:function (d) {
                        return d.full_order_info.source_info.book_key;
                    }}
                    ,{field:"total_fee",width:'8%',title:"优惠前商品总价",templet:function (d) {
                        return d.full_order_info.pay_info.total_fee;
                    }}
                    ,{field:"payment",width:'8%',title:"支付价格",templet:function (d) {
                        return d.full_order_info.pay_info.payment;
                    }}
                    ,{field:"buyer_message",width:'15%',title:"订单买家留言",templet:function (d) {
                        return d.full_order_info.remark_info.buyer_message;
                    }}
                    ,{field:"transaction",width:'15%',title:"有赞支付流水号",templet:function (d) {
                        return d.full_order_info.pay_info.transaction;
                    }}

                ]]
        };
        $tables = tables.renderTable(parmer);

        //头工具栏事件
        table.on('toolbar(lay-table)', function(obj){
            switch(obj.event){
                case '05':
                    var where = $("#queryForm").serializeObject();
                    $tables.reload({
                        where: where,
                        text: {none: '暂无数据！'}
                    });
                    break;
            };
        });
    });
</script>
</body>
</html>